package br.com.carser.business.bean;

import java.util.List;

import javax.ejb.Stateless;
import javax.inject.Inject;

import br.com.carser.business.UserBusiness;
import br.com.carser.business.infra.BaseBusinessBean;
import br.com.carser.dao.UserDAO;
import br.com.carser.dao.infra.BaseDAO;
import br.com.carser.model.User;

/**
 * Business to user bean.
 * 
 * @author Eduardo T. Serete
 */
@Stateless
public class UserBusinessBean extends BaseBusinessBean<User> implements UserBusiness {
	
	private static final long serialVersionUID = 8399051550675148420L;
	
	@Inject
	private UserDAO dao;

	@Override
	public User getByUserNamePassword(String username, String password) {
		return dao.getByUserNamePassword(username, password);
	}
	
	@Override
	public User getByEmail(String email) {
		return dao.getByEmail(email);
	}

	@Override
	public List<User> getByNameUsername(String name, String username){
		return dao.getByNameUsername(name, username);
	}

	@Override
	public BaseDAO<User> getDAO() {
		return dao;
	}

}
